<script setup>
import column from './components/column.vue'
import rose from './components/rose.vue';
import curve from './components/curve.vue';

</script>

<template>
    <div class="main">
        <div class="content">
            <div class="left">
                <!-- 标题 -->
                <div class="title">
                    <div class="big">用电对比</div>
                    <div class="small">comparison of electricity consumption</div>
                </div>
                <!-- 总电量及总电额表格 -->
                <div class="top">
                    <div class="total">
                        <!-- 总用电量 -->
                        <div class="wattage">
                            <div class="txt">
                                总用电量
                                <span>(kW/h)</span>
                            </div>
                            <div class="count">1,263,240</div>
                        </div>
                        <!-- 总用电额 -->
                        <div class="charge">
                            <div class="txt">
                                总用电额
                                <span>(RMB)</span>
                            </div>
                            <div class="count">1,263,240</div>
                        </div>
                    </div>
                    <div class="table">
                        <table border="1" style="border: 1px solid #57575e">
                            <tr>
                                <td class="ranking table-item">
                                    <span>排名</span>
                                </td>
                                <td class="regional">分区</td>
                                <td class="electric-quantity table-item">总用电量</td>
                                <td class="charge">总用电额</td>
                                <td class="ratio table-item">占比</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="first">1</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="two">2</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="three">3</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="other">4</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="other">5</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                            <tr>
                                <td class="ranking table-item">
                                    <span class="other">6</span>
                                </td>
                                <td class="regional">钢筋场</td>
                                <td class="electric-quantity table-item">253,911KW</td>
                                <td class="charge">126.955RMB</td>
                                <td class="ratio table-item">20.1%</td>
                            </tr>
                        </table>
                    </div>
                    <div class="tip">各分区用电对比图</div>
                </div>
                <!-- 折线图 -->
                <div class="bottom">
                    <!-- 同比增加用电量及用电额 -->
                    <div class="top">
                        <!--同比增加用电量  -->
                        <div class="wattage-add">
                            <div class="txt">同比增加用电量</div>
                            <div class="count">
                                +2024<span style="margin-left: 5px">KW</span>
                            </div>
                            <div class="proportion">
                                <span class="red">环比</span>
                                <span class="num"> +20.36</span>
                                <span class="arrows">↑</span>
                            </div>
                        </div>
                        <div class="charge-add">
                            <div class="txt">同比增加用电额</div>
                            <div class="count">
                                +101401<span style="margin-left: 5px">RMB</span>
                            </div>
                            <div class="proportion">
                                <span class="red" style="background-color: #4a8760">环比</span>
                                <span class="num"> +2.04</span>
                                <span class="arrows" style="color: #4a8760">↓</span>
                            </div>
                        </div>
                    </div>
                    <div class="broken">
                        <column />
                    </div>
                </div>
            </div>
            <div class="right">
                <div class="top">
                    <div class="header">
                        <div class="electric">今天用电量</div>
                        <div class="charge">今天用电额</div>
                    </div>
                    <div class="body">
                        <div class="electric">
                            <div class="count">
                                <div class="big">1403.61<span>kw</span></div>
                                <div class="small">
                                    <div class="small-left">昨日 1250.14 kw/h</div>
                                    <div class="small-right">12.28%<span>↑</span></div>
                                </div>
                            </div>
                            <div class="card">
                                <div class="current month">
                                    <div class="month-count">50210</div>
                                    <div class="txt">本月用电量(kw)</div>
                                </div>
                                <div class="last month">
                                    <div class="month-count">45150</div>
                                    <div class="txt">上月用电量(kw)</div>
                                </div>
                                <div class="relative month">
                                    <div class="month-count">+11.21%</div>
                                    <div class="txt">同比 5060(kw)<span style="color: red; margin-left: 5px;">↑</span></div>
                                </div>
                            </div>
                            <div class="rose">
                                <rose />
                            </div>
                        </div>
                        <div class="charge">
                            <div class="count">
                                <div class="big">701.80<span>RMB</span></div>
                                <div class="small">
                                    <div class="small-left">昨日 625.07 RMB</div>
                                    <div class="small-right">12.28%<span>↑</span></div>
                                </div>
                            </div>
                            <div class="card">
                                <div class="current month">
                                    <div class="month-count">252648</div>
                                    <div class="txt">本年用电额(RMB)</div>
                                </div>
                                <div class="last month">
                                    <div class="month-count">251544</div>
                                    <div class="txt">上年用电额(RMB)</div>
                                </div>
                                <div class="relative month">
                                    <div class="month-count">+0.44%</div>
                                    <div class="txt">同比 5060(rmb)<span style="color: red; margin-left: 5px;">↑</span></div>
                                </div>
                            </div>
                            <div class="rose">
                                <rose />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bottom">
                    <div class="title">今日用电曲线 <span class="small"> HToday's electricity consumption curve</span></div>
                    <div class="footer">
                        <div class="curve">
                            <curve/>
                        </div>
                        <div class="rate">
                            <div class="rate-top">
                                <div class="num">36%</div>
                                <div class="txt">负荷率</div>
                            </div>
                            <div class="rate-top" style="margin-top: 20px;">
                                <div class="num">86%</div>
                                <div class="txt">峰谷差率</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<style lang="less" scoped>
.main {
    margin: 0 auto;
    padding: 10px;
    width: 1600px;
    height: 1111px;
    background-color: #05040e;
}

.content {
    display: flex;
    width: 100%;
    height: 100%;
    // background-color: #fff;
}

.left {
    margin-right: 10px;
    padding: 25px 25px 25px 20px;
    width: 560px;
    // height: 100%;
    background-color: #201d30;

    .title {
        display: flex;
        align-items: flex-end;
        margin-bottom: 35px;
        color: #c5c5c3;
        font-weight: 700;
        font-size: 20px;

        .small {
            font-size: 10px;
            margin-left: 5px;
        }
    }

    .top {
        .total {
            margin-left: 45px;
            margin-right: 75px;
            margin-bottom: 35px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: #a2a1a8;

            .txt {
                margin-left: 5px;

                span {
                    margin-left: 4px;
                }
            }

            .count {
                margin-top: 15px;
                font-size: 30px;
                font-weight: bold;
                color: #ecae15;
            }
        }

        .table {
            margin-left: 15px;

            .table-item {
                background-color: #2c2c3e;
            }

            tr,
            td {
                vertical-align: middle;
                text-align: center;
                color: #8a898f;
                font-size: 10px;
                font-weight: 600;
            }

            tr {
                height: 25px;
            }

            .ranking {
                width: 40px;
                height: 25px;
                display: flex;
                align-items: center;
                justify-content: center;

                .first {
                    display: block;
                    width: 15px;
                    height: 15px;
                    line-height: 15px;
                    border-radius: 50%;
                    background-color: #e1623a;
                    color: #b3b3b3;
                }

                .two {
                    display: block;
                    width: 15px;
                    height: 15px;
                    line-height: 15px;
                    border-radius: 50%;
                    background-color: #ecae15;
                    color: #b3b3b3;
                }

                .three {
                    display: block;
                    width: 15px;
                    height: 15px;
                    line-height: 15px;
                    border-radius: 50%;
                    background-color: #47845d;
                    color: #b3b3b3;
                }

                .other {
                    display: block;
                    width: 15px;
                    height: 15px;
                    line-height: 15px;
                    border-radius: 50%;
                    background-color: #d8d8d8;
                    color: #b3b3b3;
                }
            }

            .regional {
                width: 75px;
            }

            .electric-quantity {
                width: 150px;
            }

            .charge {
                width: 140px;
            }

            .ratio {
                width: 100px;
            }
        }

        .tip {
            margin-left: 215px;
            margin-top: 27px;
            margin-bottom: 57px;
            // text-align: center;
            color: #a2a1a8;
        }
    }

    .bottom {
        .top {
            margin-left: 60px;
            margin-right: 60px;
            margin-bottom: 31px;
            display: flex;
            justify-content: space-between;
            color: #ffffff;
            font-size: 20px;
            font-weight: 600;

            .txt {
                margin-bottom: 5px;
                font-size: 13px;
                font-weight: normal;
                color: #7d7c83;
            }

            .proportion {
                display: flex;
                margin-top: 5px;
                align-items: flex-end;

                .red {
                    display: block;
                    font-size: 15px;
                    width: 36px;
                    height: 20px;
                    line-height: 20px;
                    text-align: center;
                    background-color: #eb1f26;
                }

                .num {
                    margin-left: 4px;
                    margin-right: 4px;
                    font-size: 13px;
                }

                .arrows {
                    font-size: 13px;
                    color: #eb1f26;
                }
            }
        }

        .broken {
            width: 100%;
            height: 500px;


        }
    }
}

.right {
    flex: 1;
    height: 100%;

    .top {
        background: #201d30;
        height: 570px;

        .header {
            display: flex;
            justify-content: space-between;

            .electric {
                width: 130px;
                height: 40px;
                line-height: 40px;
                background: #3e345e;
                border-radius: 2px;
                font-size: 20px;
                color: #f2f2f5;
                text-align: center;
            }

            .charge {
                width: 130px;
                height: 40px;
                line-height: 40px;
                background: #3e345e;
                border-radius: 2px;
                font-size: 20px;
                color: #f2f2f5;
                text-align: center;
            }
        }

        .body {
            display: flex;
            justify-content: space-between;
            padding-bottom: 30px;

            .electric {
                flex: 1;
                height: 100%;
                border-right: 1px dashed #77767e;


                .count {
                    margin-top: 35px;
                    display: flex;
                    flex-direction: column;
                    margin-left: 115px;

                    .big {
                        color: #fefefe;
                        font-size: 35px;
                        font-weight: bold;
                        margin-bottom: 15px;

                        span {
                            margin-left: 10px;
                            font-weight: normal;
                            font-size: 25px;
                        }
                    }

                    .small {
                        font-weight: 500;
                        font-size: 15px;
                        color: #7f7d89;
                        display: flex;

                        .small-right {
                            font-weight: 500;
                            margin-left: 55px;
                            font-size: 12px;
                            color: #b11f28;

                            span {
                                margin-left: 5px;
                            }
                        }
                    }
                }

                .card {
                    margin-left: 14px;
                    margin-right: 14px;
                    margin-top: 30px;
                    display: flex;
                    justify-content: space-around;

                    .month {
                        height: 80px;
                        width: 135px;
                        background-color: #49855f;
                        border-radius: 5px;
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        justify-content: center;
                        font-weight: 700;
                        font-size: 18px;
                        color: #fefefe;

                        .txt {
                            margin-top: 10px;
                            font-size: 13px;
                            color: #c6dad6;
                        }
                    }

                    .last {
                        background-color: #ecae15;
                    }

                    .relative {
                        background-color: #e0633b;
                    }
                }

                .rose {
                    margin-top: 35px;
                    margin-left: 16px;
                    margin-right: 16px;

                    border-radius: 5px;
                    width: 455px;
                    height: 255px;
                    background-color: #3e3d55;
                }
            }

            .charge {
                width: 488px;
                height: 100%;

                .count {
                    margin-top: 35px;
                    display: flex;
                    flex-direction: column;
                    margin-left: 115px;

                    .big {
                        color: #fefefe;
                        font-size: 35px;
                        font-weight: bold;
                        margin-bottom: 15px;

                        span {
                            margin-left: 10px;
                            font-weight: normal;
                            font-size: 25px;
                        }
                    }

                    .small {
                        font-weight: 500;
                        font-size: 15px;
                        color: #7f7d89;
                        display: flex;

                        .small-right {
                            font-weight: 500;
                            margin-left: 55px;
                            font-size: 12px;
                            color: #b11f28;

                            span {
                                margin-left: 5px;
                            }
                        }
                    }
                }

                .card {
                    margin-left: 14px;
                    margin-right: 14px;
                    margin-top: 30px;
                    display: flex;
                    justify-content: space-around;

                    .month {
                        height: 80px;
                        width: 135px;
                        background-color: #49855f;
                        border-radius: 5px;
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        justify-content: center;
                        font-weight: 700;
                        font-size: 18px;
                        color: #fefefe;

                        .txt {
                            margin-top: 10px;
                            font-size: 13px;
                            color: #c6dad6;
                        }
                    }

                    .last {
                        background-color: #ecae15;
                    }

                    .relative {
                        background-color: #e0633b;
                    }
                }

                .rose {
                    margin-top: 35px;
                    margin-left: 16px;
                    margin-right: 16px;

                    border-radius: 5px;
                    width: 455px;
                    height: 255px;
                    background-color: #3e3d55;
                }
            }

        }
    }

    .bottom {
        margin-top: 15px;
        padding-top: 20px;
        flex: 1;
        width: 100%;
        height: 505px;
        background-color: #201d30;

        .title {
            display: flex;
            align-items: flex-end;
            margin-left: 40px;
            color: #c5c5c3;
            font-weight: 700;
            font-size: 20px;

            .small {
                font-size: 10px;
                margin-left: 5px;
            }
        }
        .footer{
            display: flex;
            margin-left: 30px;
            margin-top: 60px;
            height: 400px;
            // background-color: #fff;
            .curve{
                width: 680px;
                height: 100%;
                // background-color: #05040e;
            }
            .rate{
                display: flex;
                flex-direction: column;
                .rate-top{
                    margin-top: 20px;
                    height: 130px;
                    width: 170px;
                    background-color: #3e3d55;
                    border-radius: 10px;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    color: #fefefe;
                    font-size: 42px;
                    font-weight: bold;
                   .txt{
                    margin-top: 15px;
                    font-weight: 300;
                    font-size: 18px;
                    color: #a7a6b2;
                   }
                }
            }
        }
    }
}
</style>
